package com.log.log4j.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ReqController {

    private static Logger logger = LoggerFactory.getLogger(ReqController.class);

    @RequestMapping("/Hello")
    public String test() {
        if (logger.isInfoEnabled()) {
            logger.info("info信息");
        }
        if (logger.isInfoEnabled()) {
            logger.debug("debug信息");
        }
        if (logger.isInfoEnabled()) {
            logger.warn("warn信息");
        }
        if (logger.isInfoEnabled()) {
            logger.error("error信息");
        }
        return "hello world";
    }
}
